﻿<local:DocumentBase x:Class="WPFExcelReport.DSTAB05AV95"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="700" Width="1024" 
                    FontSize="16"
                    Loaded="Window_Loaded"
                    Title="DSTAB50AV95"  
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <CollectionViewSource   x:Key="vwDSTPLAN" Source="{Binding Path=DSTPLAN_AB50,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="600" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="79*"></ColumnDefinition>
            <ColumnDefinition Width="361*" />
            <ColumnDefinition Width="207*"></ColumnDefinition>
            <ColumnDefinition Width="233*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0"
            Grid.ColumnSpan="4" Orientation="Horizontal" >
            <TextBlock Visibility="Hidden"  FontSize="18"  Height="40"   Width="59" Name="txt1" Margin="0,0,0,0" Text="生产单" />
            <TextBox Visibility="Hidden" Background="Yellow"  FontSize="18"  Height="36"   Width="40" Name="txtABPAUFKRS" CharacterCasing="Upper" Margin="10,0,0,0" Text="" />
            <TextBox Visibility="Hidden" Background="Green"  FontSize="18" Height="36"    Width="80" Name="txtABPAUFLFD"   Margin="15,0,0,0" Text="" />
            <Button Visibility="Hidden" FontSize="18" Content="查询" Height="40" Margin="20,0,0,0" Name="butGetData" Click="btnQuery_Click"></Button>
            <Button Content="打印"  FontSize="28" Height="40" Margin="20,0,0,0"  Name="btnPrint" Width="200" Click="btnPrint_Click"/>
            <TextBlock FontSize="28"  Margin="40,0,0,0 ">总记录数:</TextBlock>
            <TextBox FontSize="18"   Margin="40,0,0,0 " Name="txtTotal" Background="AliceBlue" Width="80"></TextBox>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.ColumnSpan="4" >
            <StackPanel>
                <TextBlock>查询DSTPLAN对应品种的所有后整理单的留位坯布数量，产出数量</TextBlock>
                <WrapPanel>
                    <TextBlock Text="生产单" Visibility="Hidden"></TextBlock>
                    <TextBlock Visibility="Hidden" Text="{Binding Path=ABPAUFKRS, Source=vwDSTPLAN}" Width="40" Background="Beige"></TextBlock>
                    <TextBlock Visibility="Hidden" Text="{Binding Path=ABPAUFLFD, Source=vwDSTPLAN}" Width="80" Background="Azure"></TextBlock>
                    <TextBlock Visibility="Hidden" Text="{Binding Path=ABPAUFPOS, Source=vwDSTPLAN}" Width="40" Background="Beige"></TextBlock>
                </WrapPanel>
            </StackPanel>
            <DataGrid CanUserReorderColumns="True"  
                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                  AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  IsSynchronizedWithCurrentItem="True" Visibility="Visible"
                  SelectionUnit="FullRow"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwDSTPLAN}}"  x:Name="ABPOSDataGrid" 
                  Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="小花号" Binding="{Binding ARTICLE}" Width="Auto"/>
                    <DataGridTextColumn Header="规格" Binding="{Binding YARN, Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                    <DataGridTextColumn Header="密度" Binding="{Binding FDDIS}" Width="Auto"/>
                    <DataGridTextColumn Header="数量" Binding="{Binding QTY}" Width="Auto"/>
                    <DataGridTextColumn Header="um" Binding="{Binding UNIT}" Width="Auto"/>
                    <DataGridTextColumn Header="交期" Binding="{Binding REQDATE}" Width="Auto"/>
                    <DataGridTextColumn Header="JW" Binding="{Binding JW}" Width="Auto"/>
                    <DataGridTextColumn Header="生产单" Binding="{Binding ABPORDER}" Width="Auto"/>
                    <DataGridTextColumn Header="纱线" Binding="{Binding Path=CYARN}" Width="Auto"/>
                    <DataGridTextColumn Header="完成" Binding="{Binding ABPERLKZ}" Width="Auto"/>
                    <DataGridTextColumn Header="日期" Binding="{Binding ABPERLDAT}" Width="Auto"/>
                    <DataGridTextColumn Header="跟单" Binding="{Binding NAME, Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
    </Grid>
</local:DocumentBase>
